package servlet;

import action.AccountPopupAction;
import action.AuctionMainAction;
import action.AuctionStatusUpdateAction;
import action.BuyData;
import action.BuySaveAction;
import action.FavorProductSaveAction;
import action.InsertBankAccount;
import action.InsertSecurity;
import action.MyAuctionListAction;
import action.MyFavorProductListAction;
import admin.action.LoginAction;
import admin.action.AdminProductListAction;
import admin.action.OneAndOneBoardAction;

public class Factory {

	public static IServletAction getAction(String URL) {
		String[] Urls = URL.split("/");
		if("getBuyData.do".equalsIgnoreCase(Urls[Urls.length-1])) {
			return new BuyData();
			
		} else if("buySave.do".equalsIgnoreCase(Urls[Urls.length-1])) {
			return new BuySaveAction();
			
		} else if("favorProductSave.do".equalsIgnoreCase(Urls[Urls.length-1])) {
			return new FavorProductSaveAction();
			
		} else if("mypage_scrap.do".equalsIgnoreCase(Urls[Urls.length-1])) {
			return new MyFavorProductListAction();
			
		} else if("auction_main.do".equalsIgnoreCase(Urls[Urls.length-1])) {
			return new AuctionMainAction();
			
		} else if("insert_security.do".equalsIgnoreCase(Urls[Urls.length-1])) {
			return new InsertSecurity();
			
		}else if("my_bank_manager.do".equalsIgnoreCase(Urls[Urls.length-1])) {
				return new InsertBankAccount();	
		
		} else if("accountPopup.do".equalsIgnoreCase(Urls[Urls.length-1])) {
			return new AccountPopupAction();
			
		} else if("mypage_auction.do".equalsIgnoreCase(Urls[Urls.length-1])) {
			return new MyAuctionListAction();	
			
		} else if("auctionStatusUpdate.do".equalsIgnoreCase(Urls[Urls.length-1])) {
			return new AuctionStatusUpdateAction();
			
		} else if("oneAndOneBoard.do".equalsIgnoreCase(Urls[Urls.length-1])) {
			return new OneAndOneBoardAction();	
			
		} else if("adminProductManagement.do".equalsIgnoreCase(Urls[Urls.length-1])) {
				return new AdminProductListAction();	
					
		} else if("login.do".equalsIgnoreCase(Urls[Urls.length-1])) {
			return new LoginAction();	
					
		}else {
			return null;
		}		
	}
}
